/*************************************************************************
	> File Name: EP58.c
	> Author: 
	> Mail: 
	> Created Time: 
 ************************************************************************/
#include <stdio.h>

#define MAX_N 1000000000

long long  is_prime[MAX_N + 5] = {0};
void init() {
    for (int i = 2; i <= MAX_N; i++) {
        if (is_prime[i]) continue;
        for (int j = i, I = MAX_N / i; j <= I; j++) {
           is_prime[i * j] = 1; 
        }
    }
    return ;
}

int main() {
    init();
    int total = 1, prime_cnt = 0;
    for (long long l = 3; l * l <= MAX_N; l += 2) {
        long long a = l * l - l + 1;
        long long b = l * l - 2 * l + 2;
        long long  c = l * l - 3 * l + 3;
        prime_cnt += (!is_prime[a]);
        prime_cnt += (!is_prime[b]);
        prime_cnt += (!is_prime[c]);
        total += 4;
        printf("%lf.0\n", 100.0 * prime_cnt / total);
        if (100.0 * prime_cnt / total >= 10) continue;
        printf("%lld\n", l);
        break;
    }
    return 0;
}
